<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>坦克大战</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div id="gameContainer">
        <div id="gameMenu" class="screen">
            <h1>坦克大战</h1>
            <div class="menu-buttons">
                <button onclick="showGame()">开始游戏</button>
                <button onclick="showLevelEditor()">关卡编辑器</button>
                <button onclick="showScores()">排行榜</button>
            </div>
        </div>

        <div id="gameScreen" class="screen hidden">
            <div class="game-header">
                <div class="info">
                    <span>生命: <span id="lives">3</span></span>
                    <span>分数: <span id="score">0</span></span>
                    <span>关卡: <span id="level">1</span></span>
                </div>
                <button onclick="showMenu()">返回菜单</button>
            </div>
            <canvas id="gameCanvas" width="800" height="600"></canvas>
        </div>

        <div id="levelEditor" class="screen hidden">
            <div class="editor-header">
                <h2>关卡编辑器</h2>
                <button onclick="showMenu()">返回菜单</button>
            </div>
            <div class="editor-container">
                <div class="editor-toolbar">
                    <h3>工具箱</h3>
                    <div class="tool-group">
                        <button class="tool-btn" data-tool="brick">砖墙</button>
                        <button class="tool-btn" data-tool="steel">钢墙</button>
                        <button class="tool-btn" data-tool="water">水域</button>
                        <button class="tool-btn" data-tool="forest">森林</button>
                    </div>
                    <div class="tool-group">
                        <button class="tool-btn" data-tool="player">玩家出生点</button>
                        <button class="tool-btn" data-tool="enemy">敌人出生点</button>
                        <button class="tool-btn" data-tool="base">基地</button>
                    </div>
                    <div class="tool-group">
                        <button class="tool-btn" data-tool="powerup">道具</button>
                        <button class="tool-btn" data-tool="erase">橡皮擦</button>
                    </div>
                    <div class="editor-actions">
                        <button onclick="clearLevel()">清空</button>
                        <button onclick="saveLevel()">保存</button>
                        <button onclick="loadLevel()">加载</button>
                        <button onclick="testLevel()">测试</button>
                    </div>
                </div>
                <canvas id="editorCanvas" width="800" height="600"></canvas>
            </div>
        </div>

        <div id="scoresScreen" class="screen hidden">
            <h2>排行榜</h2>
            <div id="scoresList"></div>
            <button onclick="showMenu()">返回菜单</button>
        </div>
    </div>

    <script src="js/game.js"></script>
    <script src="js/editor.js"></script>
    <script src="js/menu.js"></script>
</body>
</html>
